﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ServiceModel;
using Celeriq.Common;

namespace Celeriq.Client.Interfaces
{
    [ServiceContract]
    public interface ISystemCore
    {
        [OperationContract]
        BaseRemotingObject StartRepository(Guid serverId, UserCredentials credentials);

        [OperationContract]
        BaseRemotingObject StopRepository(Guid serverId, UserCredentials credentials);

        [OperationContract]
        BaseRemotingObject DataLoadRepository(Guid serverId, UserCredentials credentials);

        [OperationContract]
        int GetRepositoryCount(UserCredentials credentials);

        [OperationContract]
        List<BaseRemotingObject> GetRepositoryPropertyList(UserCredentials credentials, int pageOffSet, int recordsPerPage);

        [OperationContract]
        BaseRemotingObject SaveRepository(RepositoryDefinition repository, UserCredentials credentials);

        [OperationContract]
        bool RepositoryExists(Guid serverId, UserCredentials credentials);

        [OperationContract]
        void DeleteRepository(RepositoryDefinition repository, UserCredentials credentials);

        [OperationContract]
        void ShutDown();

        [OperationContract]
        void RestartRepositories();

        [OperationContract]
        bool Backup(Guid repositoryId, UserCredentials credentials, string backupFile);

        [OperationContract]
        bool Restore(Guid repositoryId, UserCredentials credentials, string backupFile);

        [OperationContract]
        bool ExportSchema(Guid repositoryId, UserCredentials credentials, string backupFile);

        [OperationContract]
        string[] GetBackups(UserCredentials credentials);

        [OperationContract]
        void Compress(Guid serverId, UserCredentials credentials);

        [OperationContract]
        string GetPublicKey();

        [OperationContract]
        bool IsValidCredentials(UserCredentials credentials);

        [OperationContract]
        ServerResourceSettings GetServerResourceSetting(UserCredentials credentials);

        [OperationContract]
        bool SaveServerResourceSetting(UserCredentials credentials, ServerResourceSettings settings);

        [OperationContract]
        ProfileItem[] GetProfile(Guid repositoryId, UserCredentials credentials, long lastProfileId);

        [OperationContract]
        bool AddSystemUser(UserCredentials credentials, UserCredentials user);

        [OperationContract]
        bool DeleteSystemUser(UserCredentials credentials, UserCredentials user);

        [OperationContract]
        UserCredentials[] GetUserList(UserCredentials credentials);

    }
}